.PHONY: all clean

CXX= clang
CXXFLAGS= -Og -std=c99 -Wall -Wextra
RM= rm -f

SRCS= main.c matrix.c
OBJS= ${SRCS:.c=.o}
BIN=  binary

all: ${BIN}

${BIN}: ${OBJS}
	@printf "Create $@:\n"
	${CXX} ${LDFLAGS} $> -o $@

main.o: ${$@:.o=.c}
	@printf "Create $@:\n"
	${CXX} ${CXXFLAGS} -c $< -o $@

matrix.o: ${$@:.o=.c}
	@printf "Create $@:\n"
	${CXX} ${CXXFLAGS} -c $< -o $@

clean:
	@printf "Cleaning up:\n"
	${RM} ${OBJS} ${BIN} *.core
